package com.tianji.learning.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tianji.learning.domain.po.UserNote;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tianji.learning.domain.po.UserNote;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


/**
 * <p>
 *  Mapper 接口
 * </p>
 * @author lang
 * @since 2023-04-26
 */

public interface UserNoteMapper extends BaseMapper<UserNote> {
    @Update("update user_note set quote_count=quote_count +1 ,is_gathered=true where id=#{id}")
    boolean updateNote(@Param("id") Long id);

    @Update("update user_note set quote_count=quote_count-1 where id=#{id}")
    boolean deleteNum(@Param("id") Long id);

    @Select("select quote_count from user_note where id=#{id}")
    Integer queryQuote_count(@Param("id") Long id);

    @Update("update user_note set is_gathered=false  where id=#{id}")
    boolean updateIs_gathered(@Param("id") Long id);

}
